home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / lib_se / loop_variant_2.e < prev    next >
Text File  |  1998-12-22  |  2KB  |  59 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  4. --                       http://www.loria.fr/SmallEiffel
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it 
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later 
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License 
  11. -- for  more  details.  You  should  have  received a copy of the GNU General 
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class LOOP_VARIANT_2
  17.    
  18. inherit LOOP_VARIANT;
  19.    
  20. creation {ANY}
  21.    make
  22.    
  23. feature {ANY}
  24.    
  25.    tag: TAG_NAME;
  26.  
  27.    make(t: like tag; exp: like expression; c: like comment) is
  28.       require
  29.      t /= Void; 
  30.      exp /= Void;
  31.       do
  32.      comment := c;
  33.      tag := t;
  34.      expression := exp;
  35.       ensure
  36.      comment = c;
  37.      tag = t;
  38.      expression = exp;
  39.       end;
  40.    
  41.    pretty_print is
  42.       do
  43.      if comment /= Void then
  44.         comment.pretty_print;
  45.      else
  46.         fmt.indent;
  47.      end;
  48.      fmt.put_string(tag.to_string);
  49.      fmt.put_string(": ");
  50.      expression.pretty_print
  51.       end;
  52.    
  53. invariant
  54.    
  55.    tag /= Void
  56.    
  57. end -- LOOP_VARIANT_2
  58.  
  59.